package game.view;

import game.Board;
import game.Game;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Action listener for operation button.
 * @author Natchanon Hongladaromp
 *
 */
public class OperationListener implements ActionListener
{
	private Board board;
	private String operation;

	/**
	 * Constructs for this action.
	 * @param board
	 * @param operation
	 */
	public OperationListener(Board board,String operation)
	{
		this.board = board;
		this.operation = operation;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0)
	{
		board.setOperator(operation);
		board.calculate();
	}
}
